package com.lbw.factory.abstractfactory.order;

import com.lbw.factory.abstractfactory.pizza.LDCheesePizza;
import com.lbw.factory.abstractfactory.pizza.LDPepperPizza;
import com.lbw.factory.abstractfactory.pizza.Pizza;

/**
 * @author lbw
 * @version 1.0
 * @date 2021/10/15 20:44
 */
public class LDFactory implements AbstractFactory {
    @Override
    public Pizza createPizza(String orderType) {
        System.out.println("使用的是抽象工厂模式");
        Pizza pizza = null;
        switch (orderType) {
            case "cheese":
                pizza = new LDCheesePizza();
                break;
            case "pepper":
                pizza = new LDPepperPizza();
                break;
        }
        return pizza;
    }
}
